﻿@model Razor.Models.Product

@{
    ViewBag.Title = "DemoExpression";
}

<h2>DemoExpression</h2>
<table>
<thead>
<tr><th>Property</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td>Name</td><td>@Model.Name</td></tr>
<tr><td>Price</td><td>@Model.Price</td></tr>
<tr><td>Stock level</td><td>@ViewBag.ProductCount</td></tr>
<tr><td>条件判断：</td><td></td></tr>
<tr>
<td>Stock Level</td>
<td>
@switch ((int)ViewBag.ProductCount)
{
    case 0:
    @:out of Stock 缺货
    break;
    case 1:
    <b>Low Stock低库存(@ViewBag.ProductCount)</b>
 break;
    default:
<b>货源充足：@ViewBag.ProductCount</b>
    break;
}

</td>
</tr>
</tbody>
</table>


<div data-discount="@ViewBag.ApplyDiscount" dataexpress="@ViewBag.ExpressShip" data-supplier="@ViewBag.Supplier">
    the containing element has data attributers;包含元素具有数据属性；
</div>

Discount:<input type="checkbox" checked="@ViewBag.ApplyDiscount"/>
Express:<input type="checkbox" checked="@ViewBag.ExpressShip" />
Supplier:<input type="checkbox" checked="@ViewBag.Supplier" />